<style>
  #warehouseBook-update {
    padding: 20px 25px 25px 0;
  }

  #warehouseBook-update .layui-treeSelect .ztree li a, .ztree li span {
    margin: 0 0 2px 3px !important;
  }
</style>
<div class="layui-fluid" id="warehouseBook-update">
  <form class="layui-form" action="" lay-filter="warehouseBook-update-form">
    <input type="hidden" name="warehouseid">
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">预警数量：</label>
      <div class="layui-input-block">
        <input type="text" name="warningnumber" autocomplete="off" class="layui-input"
               lay-verify="required|number" placeholder="调整预警数量">
      </div>
    </div>
    <div class="layui-form-item febs-hide">
      <button class="layui-btn" lay-submit="" lay-filter="warehouseBook-update-form-submit" id="submit"></button>
    </div>
  </form>
</div>
<script data-th-inline="javascript">
  layui.use(['febs', 'form', 'validate'], function () {
    var $ = layui.$,
        febs = layui.febs,
        layer = layui.layer,
        form = layui.form,
        warehouseBook = [[${warehouseBook}]],
        $view = $('#warehouseBook-update'),
        validate = layui.validate;

    form.verify(validate);
    form.render();
    initwarehouseBookValue();

    function initwarehouseBookValue() {
      form.val("warehouseBook-update-form", {
        "warehouseid": warehouseBook.warehouseid,
        "warningnumber": warehouseBook.warningnumber,
      });
    }

    form.on('submit(warehouseBook-update-form-submit)', function (data) {
      if (febs.nativeEqual(data.field, warehouseBook)) {
        febs.alert.warn('数据未作任何修改！');
        return false;
      }
      febs.post(ctx + 'warehouseBook/update/', data.field, function () {
        layer.closeAll();
        febs.alert.success(warehouseBook.bookname + ' 数据修改成功');
        $('#febs-warehouseBookList').find('#query').click();
      });
      return false;
    });
  });
</script>